<template>
  <div class="Choice">
    <el-table
        :data="tableData.filter(data => !search || data.name.toLowerCase().includes(search.toLowerCase()))"
        style="width: 100%">
      <el-table-column
          label="购买数量"
          prop="rnumber">
      </el-table-column>
      <el-table-column
          label="秒杀折扣"
          prop="rrule">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [{
        rrule: '1',
        rnumber: '1'
      }],
      search: ''
    }
  },
  methods: {
    getTableData(){
      this.$http.get("rjbRule/selectAll")
      .then(data => {
        this.tableData = data.data;
      })
      .catch(error => {
        console.log(data);
      });
    }
  },
  mounted() {
    this.getTableData();
  }
}
</script>

<style scoped>
.Choice {
  width: 100%;
  min-height: 100%;
  padding: 15px;
  box-sizing: border-box;
}
</style>
